<!--{include header}-->
<div id="bdw" class="bdw">
<div id="bd" class="cf">
<div id="content">
    <form action="/team/buy.php?id={$team['id']}" method="post" class="validator">
	<input id="deal-per-number" value="{$team['per_number']}" type="hidden" />
        <input id="deal-permin-number" value="{$team['permin_number']}" type="hidden" />
    <div id="deal-buy" class="box">
        <div class="box-top"></div>
        <div class="box-content">
           
            
            <div class="head">
            
            <h2>购物仅需三步</h2>
            <ol class="buy-process-bar">
                <li class="step-first current">
                    1.提交订单
                    <span class="highlight"></span>
                    <span class="arrow"></span>
                </li>
                <li>
                    2.选择支付方式
                    <span class="highlight"></span>
                    <span class="arrow"></span>
                </li>
                <li class="step-last">
                    3.购买成功
                </li>
            </ol>

            <h2>
            <!--{if $team['farefree'] == -1}-->&nbsp;(本单免运费)
            <!--{else if $team['farefree']>0}-->&nbsp;(<span class="currency">{$team['farefree']}</span>件免运费)<!--{/if}-->
            </h2>
            
            </div>
            <div class="sect">

            <table class="order-table">
                <tr>
                    <th class="deal-buy-desc">项目名称</th>
                    <th class="deal-buy-quantity">数量</th>
                    <th class="deal-buy-multi"></th>
                    <th class="deal-buy-price">价格</th>
                    <th class="deal-buy-equal"></th>
                    <th class="deal-buy-total">总价</th>
                </tr>
                <tr>

                    <td class="deal-buy-desc">{$team['title']}</td>
                    <td class="deal-buy-quantity">
                    	<img src="/static/img/jian.gif" id="team_num_jian" style="cursor:pointer;"/>
                    	<input type="text" class="input-text f-input" maxlength="4" name="quantity" value="{$order['quantity']}" id="deal-buy-quantity-input" ${$team['per_number']==1?'readonly':''} />
                    	<img src="/static/img/jia.gif" id="team_num_jia" style="cursor:pointer"/>
                    	<input type="hidden" id="deal-buy-farefree" value="${abs(intval($team['farefree']))}"/>
             
                    	<br /><span style="font-size:12px;color:gray;"><!--{if $team['per_number']==0}-->最多9999件<!--{else}-->最多{$team['per_number']}件<!--{/if}--><br /><!--{if $team['permin_number']>1 && ($team['permin_number']<$team['per_number']||$team['per_number']==0)}-->最少{$team['permin_number']}件<!--{/if}--></span>
	                 </td>
                    <td class="deal-buy-multi">x</td>
                    <td class="deal-buy-price"><span class="money">{$currency}</span><span id="deal-buy-price">{$team['team_price']}</span></td>
                    <td class="deal-buy-equal">=</td>
                    <td class="deal-buy-total"><span class="money">{$currency}</span><span id="deal-buy-total">{$order['quantity']*$team['team_price']}</span></td>
                </tr>
				<!--{if $team['delivery']=='express'}-->

                <tr>
                    <td class="deal-buy-desc"></td>
                    <td class="deal-buy-quantity"></td>
                    <td class="deal-buy-multi"></td>
                    <td class="deal-buy-price"></td>
                    <td class="deal-buy-equal"></td>
                    <td class="deal-buy-total">
                    	<input type="radio" style="display:none;" class="express-price" name="express_price" value="{$express[0]['relate_data']}" title="{$express[0]['id']}" checked="checked" />
                    	<input type="hidden" id="express-id" name="express_id" value="{$express[0]['express_id']}">
                    	运费:
                    	<span class="money">{$currency}</span>
                    	<span id="deal-express-total" v="{$express[0]['relate_data']}">{$express[0]['relate_data']}</span>
      
                    </td>
                </tr>
				<!--{/if}-->
				
				

				<tr class="order-total">
                    <td class="deal-buy-desc"><strong>订单总额：</strong></td>
                    <td class="deal-buy-quantity"></td>
                    <td class="deal-buy-multi"></td>
                    <td class="deal-buy-price"></td>
                    <td class="deal-buy-equal">=</td>
                    <td class="deal-buy-total"><span class="money">{$currency}</span><strong id="deal-buy-total-t">{$order['origin']}</strong></td>
                </tr>
            </table>

			<!--{if $team['delivery']=='express'}-->
			
			<div class="wholetip clear"><h3>快递信息<!--{if $INI['alipay']['aliaddress'] == 'Y' && $_SESSION['ali_token']}-->&nbsp;<a href="/alifast/user_logistics_address_query.php"><img src="/static/css/i/aliaddress.png" /></a><!--{/if}--></h3></div>
			<div id="address-list">
			<!--{if $address }-->
				<!--{loop $address $index $one}-->
				<span id="address-list-{$one['id']}" class="address-list-pannal" style="display: block; margin: 0pt 20px; padding: 3px 5px;">
				<label for="address-list-input">
				<input id="address-list-input-{$one['id']}" type="radio" value="{$one['id']}" name="address-list" <!--{if $one['default']=='Y'}-->checked<!--{/if}--> /> {$one['name']} , {$one['province']} {$one['area']} {$one['city']} {$one['street']} , {$one['zipcode']} , {$one['mobile']}
				</label>
				</span>
				<!--{/loop}-->
				<span id="address-list-0" class="address-list-pannal" style="display: block; margin: 0pt 20px; padding: 3px 5px;">
				<label for="address-list-input">
				<input id="address-list-input-0" type="radio" name="address-list" value="0" <!--{if !$address || !$def}-->checked<!--{/if}--> />
				使用其它地址
				</label>
				</span>
				</div>
			<div class="other-address" style="display:none">
			</div>
			<!--{else}-->
				<span id="address-list-0" class="address-list-pannal" style="display: block; margin: 0pt 20px; padding: 3px 5px;">
				<label for="address-list-input">
				<input id="address-list-input-0" type="hidden" name="address-list" value="0" <!--{if !$address || !$def}-->checked<!--{/if}--> />
				
				</label>
				</span>
				</div>
			<div class="other-address" style="display:none">
				
				<table id="address-table0" class="address-table">
  <tr>
    <th>省市区</th>
    <td><div id="area-container0">
        <select name="address-province"  id="s1" id="province" class="f-input" style="width:140px;margin:2px 15px 2px 0;" require="true" datatype="require">
        <option value="">-----</option>
        </select>
        <select style="width:140px;margin:2px 15px 2px 2px;" id="s2" name="address-area" class="f-input" require="true" datatype="require">
          <option value="">-----</option>
        </select>
        <select style="width:140px;margin:2px 15px 2px 2px;" id="s3" name="address-city" class="f-input" >
          <option value="">-----</option>
        </select>
      </div>
      <div id="address-district-error0" class="blk-error"></div></td>
  </tr>
  <tr>
    <th>街道地址</th>
    <td><input type="text" maxlength="60" size="60" name="address-street" id="address-detail0" class="f-input address-detail" require="true" datatype="require" />
      <div id="address-detail-error0" class="blk-error"></div></td>
  </tr>
  <tr>
    <th>邮政编码</th>
    <td><input id="address-zipcode0" class="f-input address-zipcode" type="text" require="true" datatype="zip" maxLength="6" size="10" name="zipcode"   />
      <div id="address-zipcode-error0" class="blk-error"></div></td>
  </tr>
  <tr>
    <th>收货人姓名</th>
    <td><input type="text" maxlength="15" size="15" name="relname" id="address-name0" class="f-input address-name"  require="true" datatype="require" />
      <div id="address-name-error0" class="blk-error"></div></td>
  </tr>
  <tr>
    <th><label for="address-phone0">电话号码</label></th>
    <td><input id="address-phone0" class="f-input address-phone" type="text" require="true" datatype="mobile" maxLength="11" size="15" name="mobile"  />
      <div id="address-phone-error0" class="blk-error"></div></td>
  </tr>
</table>
</div>	
<script type="text/javascript">

</script>
<!--{/if}-->
			
			
			

		
			
			<div>
			<p class="addOfAliPay" style="font-size:16px;padding: 8px 18px;">
			希望的送货时间:
			</p>
				<span class="address-list-send-time" style="display: block; margin: 0pt 20px; padding: 5px 5px;">
				<label for="address-send-input">
				<input id="address-list-input-time" type="radio" value="只工作日送货(双休日、假日不用送，写字楼/商用地址客户请选择)" name="express_xx" checked />只工作日送货(双休日、假日不用送，写字楼/商用地址客户请选择)
				</label>
				</span>
				<span class="address-list-send-time" style="display: block; margin: 0pt 20px; padding: 5px 5px;">
				<label for="address-send-input">
				<input id="address-list-input-time" type="radio" value="只双休日、假日送货(工作日不用送)" name="express_xx" />只双休日、假日送货(工作日不用送)
				</label>
				</span>
				<span class="address-list-send-time" style="display: block; margin: 0pt 20px; padding: 5px 5px;">
				<label for="address-send-input">
				<input id="address-list-input-time" type="radio" value="学校地址/地址白天没人，请尽量安排其它时间送货 (特别安排可能会超出预计送货天数)" name="express_xx" />学校地址/地址白天没人，请尽量安排其它时间送货 (特别安排可能会超出预计送货天数)
				</label>
				</span>
				<span class="address-list-send-time" style="display: block; margin: 0pt 20px; padding: 5px 5px;">
				<label for="address-send-input">
				<input id="address-list-input-time" type="radio" value="工作日、双休日与假日均可送货" name="express_xx" />工作日、双休日与假日均可送货
				</label>
				</span>
			</div>
			<!--{else}-->
			<div class="field mobile">
				<label>手机号码</label>
				<input type="text" size="30" name="mobile" id="settings-mobile" class="number" value="{$login_user['mobile']}" require="true" datatype="mobile" maxLength="11" /><span class="inputtip">请填写正确的手机号码（可为朋友代买）</span>
			</div>
			<!--{/if}-->
			<div class="wholetip clear"><h3>附加信息</h3></div>
			
			<!--{if is_array($team['condbuy']) && !empty($team['condbuy'][0])}-->
			<div class="field mobile">
				<label>订购选择</label>
				<!--{loop $team['condbuy'] $index $one}-->
				<select name="condbuy[]" class="f-input" require="true" datatype="require" style="width:auto;"><option value="">请选择</option>${Utility::Option(array_combine($one, $one), 'condbuy')}</select> 
				<!--{/loop}-->
			</div>
			<!--{/if}-->
			<div class="field mobile">
				<label>订单附言</label>
				<textarea name="remark" style="width:500px;height:80px;padding:2px;">${htmlspecialchars($order['remark'])}</textarea>
			<!--{if $team['delivery']=='express'}-->
			<div class="expresstip">${nl2br(htmlspecialchars($team['express']))}</div>
			<!--{/if}-->
			</div>
            <input type="hidden" name="id" value="{$order['id']}" />
            <!--{if $havebind}-->
            <div class="wholetip clear"><h3>手机绑定</h3></div>
            <div class="field mobile">
				<label>已绑定手机：</label>
				{$mobile_num}
			</div>
			<!--{/if}-->
			<div class="form-submit"><input type="submit" class="formbutton" name="buy" value="确认无误，购买"/></div>
            </div>
        </div>
        <div class="box-bottom"></div>
    </div>
    </form>
</div>
<div id="sidebar">


</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->
<script type="text/javascript" src="/static/js/city.js"></script>
<script language="javascript">
$(document).ready(function(){
	if($('#address-list-input-0').attr("checked") == true){
		$('.other-address').css('display','block');
	}else{
		$('.other-address').css('display','none');
	
	}
	$( "input[name='address-list']" ).bind( "click", othercheck );
	function othercheck(){
		if($('#address-list-input-0').attr("checked") == true){
			$('.other-address').css('display','block');
			$('.other-address').html('<table id="address-table0" class="address-table"><tr><th>省市区</th><td><div id="area-container0"><select name="address-province"  id="s1" id="province" class="f-input" style="width:140px;margin:2px 15px 2px 0;" require="true" datatype="require"><option value="">-----</option></select><select style="width:140px;margin:2px 15px 2px 2px;" id="s2" name="address-area" class="f-input" require="true" datatype="require"><option value="">-----</option></select><select style="width:140px;margin:2px 15px 2px 2px;" id="s3" name="address-city" class="f-input" ><option value="">-----</option></select></div><div id="address-district-error0" class="blk-error"></div></td></tr><tr><th>街道地址</th><td><input type="text" maxlength="60" size="60" name="address-street" id="address-detail0" class="f-input address-detail" require="true" datatype="require" /><div id="address-detail-error0" class="blk-error"></div></td></tr><tr><th>邮政编码</th><td><input id="address-zipcode0" class="f-input address-zipcode" type="text" require="true" datatype="zip" maxLength="6" size="10" name="zipcode"   /><div id="address-zipcode-error0" class="blk-error"></div></td></tr><tr><th>收货人姓名</th><td><input type="text" maxlength="15" size="15" name="relname" id="address-name0" class="f-input address-name"  require="true" datatype="require" /><div id="address-name-error0" class="blk-error"></div></td></tr><tr><th><label for="address-phone0">电话号码</label></th><td><input id="address-phone0" class="f-input address-phone" type="text" require="true" datatype="mobile" maxLength="11" size="15" name="mobile"  /><div id="address-phone-error0" class="blk-error"></div></td></tr></table>');
			setupcity();
		}else{
			$('.other-address').css('display','none');
			$('.other-address').html("");
		}
	}
});


setupcity();
</script>
<script>
/*window.x_init_hook_dealbuy = function(){
	X.team.dealbuy_farefree(${abs(intval($order['quantity']))});
	X.team.dealbuy_totalprice();
};*/
</script>

<!--{include footer}-->
